package com.scnb.memento;

public class Main {
    public static void main(String[] args) {
        Originator originator = new Originator();
        originator.setState("原始状态");

        Caretaker caretaker = new Caretaker();
        caretaker.setMemento(originator.createMemento());

        originator.setState("被改变后的状态");
        originator.showState();

        originator.setMemento(caretaker.getMemento());
        originator.showState();
    }
}


